<template>
  <div class="create-page">
    <el-page-header title="返回" content="创意工坊" @back="smartBack" />
    <div class="hand-drawn-list">
      <HandDrawnCard
        v-for="item in list"
        :key="item.title"
        variant="primary"
        size="medium"
        @click="$router.push(item.path)"
      >
        <h1 class="hand-drawn-title">{{ item.title }}</h1>
        <div class="center">
          <span class="desc">{{ item.desc }}</span>
        </div>
        <div class="center">
          <HandDrawnCard variant="accent" size="small">
            <div class="hand-drawn-button">进入</div>
          </HandDrawnCard>
        </div>
      </HandDrawnCard>
    </div>
  </div>
</template>

<script lang="ts">
import { Options, Vue } from "vue-class-component";
import HandDrawnCard from "@/components/HandDrawnCard.vue";
@Options({
  components: {
    HandDrawnCard,
  },
})
export default class CreatePage extends Vue {
  list = [
    {
      title: "装备编辑器",
      desc: "创建自定义装备，设置属性、品质、来源等，让你的创意在游戏中发光发热",
      path: "/create/CreateEquip",
    },
    { title: "形象编辑器", desc: "自定义角色形象", path: "/create/ImageEditor" },
  ];
  smartBack() {
    if (window.history.length > 1) {
      this.$router.back();
    } else {
      this.$router.push("/");
    }
  }
}
</script>

<style scoped>
.create-page {
  min-height: 100vh;
  background: #232e23;
  padding: 0 0 40px 0;
}
.hand-drawn-list {
  max-width: 600px;
  margin: 0 auto;
  padding-top: 24px;
}
.hand-drawn-title {
  font-size: 22px;
  font-weight: bold;
  color: #ffe066;
  text-align: center;
  margin-bottom: 8px;
}
.center {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
}
.desc {
  color: #fff;
  font-size: 15px;
  text-align: center;
  margin-bottom: 8px;
}
.hand-drawn-button {
  text-align: center;
  font-weight: bold;
  font-size: 15px;
  color: #ffffff;
  cursor: pointer;
  user-select: none;
  padding: 2px 16px;
  background: transparent;
  border-radius: 3px;
  transition: all 0.2s ease;
}
.hand-drawn-button:hover {
  color: #d2691e;
}
</style>
